package com.fbs.wowo.correctRight.service.imp;

import com.fbs.wowo.correctRight.entity.CopyrightWorksType;
import com.fbs.wowo.correctRight.mapper.CopyrightWorksTypeMapper;
import com.fbs.wowo.correctRight.service.CopyrightWorksTypeService;
import com.fbs.wowo.util.common.ComUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * 作品类型
 */
@Service("CopyrightWorksTypeService")
@Transactional
public class CopyrightWorksTypeServiceImp implements CopyrightWorksTypeService {

    @Resource
    private CopyrightWorksTypeMapper copyrightWorksTypeMapper;

    /**
     * 添加类型
     * @param record
     * @return
     */
    @Override
    public int insertSelective(CopyrightWorksType record) {
        record.setCwtId(ComUtils.getUUID());
        record.setCreateDate(new Date());
        return copyrightWorksTypeMapper.insertSelective(record);
    }

    @Override
    public List<CopyrightWorksType> findAll() {
        return copyrightWorksTypeMapper.findAll();
    }

    @Override
    public CopyrightWorksType selectByPrimaryKey(String id) {
        return copyrightWorksTypeMapper.selectByPrimaryKey(id);
    }

}
